<!DOCTYPE html>
<html lang="en">
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Document</title>
  <style>
    button {
      opacity: 0.99;
      transition: opacity 2s;
    }
    button:not(:disabled):active {
      opacity: 1;
      transition: 0s;
    }
  </style>
  <body>
    <button>带节流的btn</button>
    <script>
      const btn = document.querySelector("button");
      btn.addEventListener("transitionend", (e) => {
        e.target.disabled = false;
      });
      btn.addEventListener("transitionstart", (e) => {
        e.target.disabled = true;
      });
    </script>
  </body>
</html>
